<template>
  <div>
    <div class="recommend-title">猜你喜欢</div>
    <ul>
      <router-link
        tag="li"
        class="item border-bottom"
        v-for="item of list"
        :key="item.id"
        :to="'/detail/'+item.id"
      >
        <img class="item-img" :src="item.imgUrl">
        <div class="item-info">
          <div class="item-title">{{item.title}}</div>
          <div class="item-descript">
            <img :src="item.star">
            <span>{{item.evaluate}}</span>
            <span>月售{{item.monthsales}}单</span>
            <p class="item-descript-position">
              <span class="item-button">首</span>
              <span>新用户下单立减15元</span>
            </p>
          </div>
          <div class="item-desc">
            <div class="item-doller">
              ￥
              <span class="item-money">{{item.money}}</span>
            </div>
            <div>{{item.distance}}</div>
          </div>
          <button class="item-button">查看详情</button>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: "HomeRecommend",
  props: {
    list: Array
  },
  data() {
    return {};
  }
};
</script>

<style lang="stylus" scoped>
@import '~styles/mixins.styl';

.recommend-title {
  line-height: 0.8rem;
  background: #eee;
  text-indent: 0.2rem;
}

.item {
  overflow: hidden;
  display: flex;
  height: 2.4rem;
}

.item-img {
  width: 2rem;
  height: 2rem;
  padding: 0.1rem;
}

.item-doller {
  color: #999
  font-size :.24rem
}

.item-descript-position{
  margin-top :.2rem
}

.item-money {
  font-size: 0.3rem
  color: #999
  font-size :.24rem
}

.item-info {
  flex: 1;
  flex-direction: column;
  padding: 0.1rem;
  min-width: 0;
}

.item-descript {
  font-size: 0.2rem;
}

.item-title {
  font-size: 0.32rem;
  line-height: 0.54rem;
  ellipsis();
}

.item-desc {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  line-height: 0.4rem;
  margin-top: 0.1rem;
  color :#999
  font-size :.24rem
}

.item-button {
  background: #ff9300;
  border-radius: 0.06rem;
  margin-top: 0.1rem;
  color: #fff;
}
</style>